<template>
  <div class="input-group">
    <input type="text" v-model="value">
    <button @click="handle">添加</button>
  </div> 
  <!-- 左边的list是传给子组件的，右边的list是数组 -->
  <Child ></Child>  
</template>

<script setup>
import { ref,provide } from 'vue';
import Child from './components/Child5.vue'

const value=ref('')
const list=ref(['html'])
const handle=()=>{
  list.value.push(value.value)
}

provide('list',list.value)  //父组件提供

</script>
<style >
#app{
  width: 300px;
}
.input-group{
  width: 100%;
  display: flex;
}
</style>
